

package com.zhanghuan.scheduler.job.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务
 *
 */
@Data
@Table(name = "schedule_job")
@Entity
public class ScheduleJobEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 任务调度参数key
	 */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
	
	/**
	 * 任务id
	 */
	@Id
	private String jobId;

	/**
	 * spring bean名称
	 */
	@Column(name = "bean_name")
	private String beanName;
	
	/**
	 * 参数
	 */
	@Column(name = "params")
	private String params;
	
	/**
	 * cron表达式
	 */
	@Column(name = "cron_expression")
	private String cronExpression;

	/**
	 * 任务状态
	 */
	@Column(name = "status")
	private Integer status;

	/**
	 * 备注
	 */
	@Column(name = "remark")
	private String remark;

	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Column(name = "create_time")
	private Date createTime;

}
